package com.dingreading.cloud.admin.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.RelationOneToMany;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
public class StaffPageDto implements Serializable {

    private Long id;

    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date addTime;

    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date editTime;

    /**
     * 创建人uid
     */
    private String addStaffUid;

    /**
     * 创建人姓名
     */
    private String addStaffName;

    /**
     * 更新人uid
     */
    private String lastStaffUid;

    /**
     * 更新人姓名
     */
    private String lastStaffName;

    private Integer enabled;

    private String username;

    private String fullName;

    private String nickName;

    private String priPhone;

    private String pubPhone;

    private String uid;

    private String token;

    private String authApps;

    private String corpUid;

    private String currentStoreUid;

    private String lastLoginTime;

    @RelationOneToMany(selfField = "uid", targetTable = "staff_roles", targetField = "staffUid")
    private List<StaffRolesDto> staffRolesList;

    /**
     * 员工活动主目录权限
     */
    private String subjectType;

    /**
     * 员工活动主目录权限
     */
    @RelationOneToMany(
            selfField = "subjectType",
            selfValueSplitBy = ",", //使用 "," 对值进行分割
            targetTable = "subjects", //只获取某个字段值需要填入目标表名
            targetField = "id",
            valueField = "subjectName"
    )
    private List<String> subjectTypeNames;

}
